package dao

import "gorm.io/gorm"

type Group struct {
	gorm.Model
	GroupName       string `json:"groupName" gorm:"type:varchar(60);not null;comment:'群名称'"`
	GroupHeardImage string `json:"groupHeardImage" gorm:"type:varchar(255);not null;comment:'群头像'"`
	GroupRemark     string `json:"groupRemark" gorm:"type:varchar(255);not null;comment:'群公告'"`
}

type GroupMember struct {
	gorm.Model
	UserId        int    `json:"userId" gorm:"type:int(10);not null;comment:'用户编号'"`
	GroupId       int    `json:"groupId" gorm:"type:int(10);not null;comment:'群编号'"`
	Type          int    `json:"type" gorm:"tinyint(1);default:3;comment:'1-群主2-管理员3-群成员'"`
	GroupNickName string `json:"groupNickName" gorm:"type:varchar(60);not null;comment:'在群里的昵称'"`
}

type GroupMessage struct {
	gorm.Model
	UserId  int    `json:"userId" gorm:"type:int(10);not null;comment:'用户编号'"`
	GroupId int    `json:"groupId" gorm:"type:int(10);not null;comment:'群编号'"`
	Content string `json:"content" gorm:"type:varchar(255);not null;comment:'消息内容'"`
	Type    int    `json:"type" gorm:"type:tinyint(1);not null;comment:'1-文本2-图片'"`
}

type GroupTop struct {
	gorm.Model
	GroupId int `json:"groupId" gorm:"type:int(10);not null;comment:'群编号'"`
	UserId  int `json:"userId" gorm:"type:int(10);not null;comment:'用户编号'"`
	Top     int `json:"top" gorm:"tinyint(1);default:0;comment:0-未置顶1-已置顶"`
}
